package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    /**
     * 口味相关数据库
     * @param flavors
     */
    @AutoFill(value = OperationType.INSERT)
    void Insert2(List<DishFlavor> flavors);


    /**
     * id集合跟单个id删除对应口味
     * @param ids
     */
    void dishByDishIds(List<Long> ids);

    @Delete("delete from dish_flavor where dish_id =#{id}")
    void delectDish(Long id);


    /**
     * id查询口味
     */
    @Select("select * from dish_flavor where id=#{dishid}")
    List<DishFlavor> getByDishId(Long dishid);

}
